﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.ExportToRTR.CApExportToRTRObjectsValidator
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using DnProcessSimulateCommands.ExportToRTR.Resources;
using Tecnomatix.Engineering;


namespace DnProcessSimulateCommands.ExportToRTR{

internal class CApExportToRTRObjectsValidator : CApExportToRTRBaseValidator
{
  public static TxTypeFilter Filter
  {
    get
    {
      TxTypeFilter filter = new TxTypeFilter();
      filter.AddIncludedType(typeof (TxComponent));
      filter.AddIncludedType(typeof (TxCompoundResource));
      filter.AddIncludedType(typeof (TxCompoundPart));
      filter.AddIncludedType(typeof (TxPartAppearance));
      filter.AddIncludedType(typeof (ITxDevice));
      filter.AddIncludedType(typeof (ITxGeometry));
      filter.AddIncludedType(typeof (TxLogicalCollection));
      filter.AddExcludedType(typeof (TxSection));
      filter.AddExcludedType(typeof (TxSweptVolume));
      filter.AddExcludedType(typeof (TxInterferenceVolume));
      filter.AddExcludedType(typeof (TxSeamMfgFeature));
      filter.AddExcludedType(typeof (TxTCPTrackObject));
      return filter;
    }
  }

  public override bool IsValidObject(ITxObject obj, out string errorMessage)
  {
    bool flag = false;
    errorMessage = ExportToRTRStringTable.VALIDATOR_INVALID_OBJECT_ERROR;
    if (CApExportToRTRObjectsValidator.Filter.DoesPassFilter(obj) && obj is ITxDisplayableObject displayableObject)
    {
      if (CApExportToRTRUtils.IsVisibleAndHaveApprox(displayableObject))
      {
        flag = true;
        errorMessage = (string) null;
      }
      else
        errorMessage = ExportToRTRStringTable.VALIDATOR_BLANK_OBJECT_ERROR;
    }
    return flag;
  }
}
